﻿using Solution.Core.Dependency;
using System.Threading.Tasks;

namespace Solution.Core.Repository
{
    public interface IRedisSingletoneClient : ITransientDependency
    {
        Task<bool> AddAsync<T>(string key, T value, int db = 0);

        Task<bool> SetAddAsync<T>(string key, T value, int db = 0) where T : class;

        Task<T> GetAsync<T>(string key, int db = 0);

        Task<bool> ExistsAsync(string key, int db = 0);

        Task<bool> Lock(string key, int expireTimeSeconds = 30, int waitTimeSeconds = 10);

        Task<bool> UnLock(string key);
    }
}